//
//  LYQCardEditPersonInfoTableViewCell.m
//  ZCProject
//
//  Created by 崔明燃 on 16/11/16.
//  Copyright © 2016年 Zheng. All rights reserved.
//

#import "LYQCardEditPersonInfoTableViewCell.h"

@implementation LYQCardEditPersonInfoTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.infoTextField];
        [self.contentView addSubview:self.arrowImg];
        
        [self subViewsLayout];
    }
    
    return self;
}

#pragma mark - layout subViews
- (void)subViewsLayout {
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.left.equalTo(self.contentView.mas_left).offset(10);
        make.width.equalTo(@40);
        make.height.equalTo(@30);
    }];
    
    [_infoTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.left.equalTo(_titleLabel.mas_right).offset(25);
        make.width.equalTo(@40);
        make.height.equalTo(@30);
    }];
    
    [_arrowImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.right.equalTo(self.contentView.mas_right).offset(-10);
        make.width.equalTo(@7);
        make.height.equalTo(@10);
    }];
}


#pragma mark - lazy load
- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.text = @"性别";
        _titleLabel.font = kFont(15);
    }
    
    return _titleLabel;
}

- (UITextField *)infoTextField {
    if (!_infoTextField) {
        _infoTextField = [[UITextField alloc] init];
//        _infoTextField.text = @"男";
        _infoTextField.font = kFont(15);
        
    }
    
    return _infoTextField;
}

- (UIImageView *)arrowImg {
    if (!_arrowImg) {
        _arrowImg = [[UIImageView alloc] init];
//        _arrowImg.backgroundColor = [UIColor redColor];
        _arrowImg.image = [UIImage imageNamed:@"morejticon"];
    }
    
    return _arrowImg;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
